<template>
  <div id="app">
    <div class="tab-bar">
      <i class="el-icon-back back" @click="back"></i>
      <div class="search">
        <i class="el-icon-search"></i>
        <input v-model="key" type="text" @input="search" placeholder="搜索"/>
      </div>
      <div class="content">
        <div class="menu">
          <div class="item" @click="riskTable">风险配置表</div>
        </div>
        <i class="el-icon-s-marketing icon"></i>
      </div>
    </div>
    <keep-alive>
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>

export default {
  name: 'App',
  data() {
    return {
      key: '',
      count: ''
    }
  },
  mounted() {
    this.$router.push("/")
  },
  methods: {
    back() {
      this.$router.back()
    },
    search() {
      this.bus.$emit('search', this.key)
    },
    riskTable() {
      this.$router.push("/risk-table")
    }
  }
}
</script>

<style lang="stylus">
body, html
  width 100%
  height 100%
  font-family 'PingFang SC', 'STHeitiSC-Light', 'Helvetica-Light', arial, sans-serif, 'Droid Sans Fallback'

  #app
    position relative
    width 100%
    height 100%

    .tab-bar
      position absolute
      display flex
      align-items center

      width 100%
      height 46px
      background white
      border-bottom #eee 1px solid
      box-shadow 0 0 4px #eee
      z-index 999

      .back
        font-size 25px
        color #333
        margin-left 15px
        cursor pointer

      .content
        display flex
        align-items center
        justify-content flex-end
        flex 1
        box-sizing border-box
        padding 0 12px

        .menu
          margin 15px
          font-size 14px
          color #6363e7
          font-weight bold

          .item
            cursor pointer

        .icon
          font-size 30px
          color #6363e7

      .search
        display flex
        align-items center
        height 30px
        margin 0 15px

        i
          font-size 15px
          color #ccc

        input
          height 30px
          background white
          border 0
          border-radius 3px
          outline none
          padding 0 6px

          color #666
          font-size 12px

</style>
